library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

PACKAGE common IS
	constant PLAYER_LEFT: std_logic := '0';
	constant PLAYER_RIGHT: std_logic := '1';
	constant PLAYER_CUT_NONE: std_logic := '0'; -- 没有砍树
	constant PLAYER_CUT_ING: std_logic := '1'; -- 正在砍树
	constant TRUNK_MAXN: integer := 10;
	constant HP_OFFSET: integer := 20;
	constant HP_RESTART: std_logic_vector(9 downto 0) := "1100000000";
	constant HP_MAXN: std_logic_vector(9 downto 0) := "1000000000";
	constant HP_ZERO: std_logic_vector(9 downto 0) := (others => '0');
	constant CMD_NONE: std_logic_vector(3 downto 0) := (others => '0'); -- 没有操作
	constant CMD_KEEP: std_logic_vector(3 downto 0) := "0001"; -- 由于某些原因，保持原来的状态
	constant CMD_PLAYER_LEFT: std_logic_vector(3 downto 0) := "0010"; -- 玩家左边按下
	constant CMD_PLAYER_RIGHT: std_logic_vector(3 downto 0) := "0100"; -- 玩家右边按下
	constant CMD_RESTART: std_logic_vector(3 downto 0) := "1000"; -- 重新开始
	constant TIMER_INTERVAL: integer := 100;
	constant TIMER_HP: integer := 70;
	
	type ITrunk is (TRUNK_L, TRUNK_DL, TRUNK_R, TRUNK_DR, TRUNK_N, TRUNK_USELESS1, TRUNK_USELESS2, TRUNK_USELESS3);
	type ITrunkList is array (TRUNK_MAXN-1 downto 0) of ITrunk;
END common;